all: redis_dlock

CPP = g++
CPPFLAGS = -std=c++11 -g
LIBS = -lpthread

%.o : %.cpp
	$(CPP) $(CPPFLAGS) -c $< -o $@


redis_dlock: redis_distributed_lock.o
	$(CPP) $^ -o redis_dlock $(LIBS) hiredis/libhiredis.a

.PHONY: clean
clean:
	rm -rf redis_dlock *.o